-------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  E:\REStat_MS14767_Vol96(2)\Data preparation Compustat segment\12_estimation_sample.log
  log type:  text
 opened on:  19 Dec 2014, 21:50:39

. *---------------------------------------------------------------
. 
. 
. ********************************************************************************
. ********                                                              **************
. ********      in this file we create the final estimation sample  **************
. ********                                                                **************
. ********************************************************************************
. 
. use "segment_compustatvars.dta", clear

. so ticker year

. ********************************************************
. *****          here we add the variables related to RJV participation (see RJVpartic.do)
. ********************************************************
. 
. merge 1:m ticker year SIC using "RJVvars.dta"

    Result                           # of obs.
    -----------------------------------------
    not matched                       161,847
        from master                   153,088  (_merge==1)
        from using                      8,759  (_merge==2)

    matched                            16,843  (_merge==3)
    -----------------------------------------

. tab _merge

                 _merge |      Freq.     Percent        Cum.
------------------------+-----------------------------------
        master only (1) |    153,088       85.67       85.67
         using only (2) |      8,759        4.90       90.57
            matched (3) |     16,843        9.43      100.00
------------------------+-----------------------------------
                  Total |    178,690      100.00

. drop if _merge == 2
(8759 observations deleted)

. drop _merge

. 
. ********************************************************
. *****          here we add the variables related to links(see links.do)
. ********************************************************
. 
. so ticker year

. merge 1:1 ticker year SIC using links.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                       159,152
        from master                   159,152  (_merge==1)
        from using                          0  (_merge==2)

    matched                            10,779  (_merge==3)
    -----------------------------------------

. tab _merge

                 _merge |      Freq.     Percent        Cum.
------------------------+-----------------------------------
        master only (1) |    159,152       93.66       93.66
            matched (3) |     10,779        6.34      100.00
------------------------+-----------------------------------
                  Total |    169,931      100.00

. drop _merge

. 
. 
. ********************************************************
. *****           here we add the variables related to patents (see patentvars.do)
. ********************************************************
. 
. so cusip year

. merge 1:1 cusip year SIC using "patentvars.dta"

    Result                           # of obs.
    -----------------------------------------
    not matched                       161,106
        from master                   161,106  (_merge==1)
        from using                          0  (_merge==2)

    matched                             8,825  (_merge==3)
    -----------------------------------------

. tab _merge

                 _merge |      Freq.     Percent        Cum.
------------------------+-----------------------------------
        master only (1) |    161,106       94.81       94.81
            matched (3) |      8,825        5.19      100.00
------------------------+-----------------------------------
                  Total |    169,931      100.00

. drop _merge

. 
. ************************************************************
. ***             some other patent vars are added (see patentpanel.do)
. ************************************************************
. 
. 
. merge m:1 ticker year using "patentpanel.dta"

    Result                           # of obs.
    -----------------------------------------
    not matched                       172,991
        from master                   140,252  (_merge==1)
        from using                     32,739  (_merge==2)

    matched                            29,679  (_merge==3)
    -----------------------------------------

. tab _merge

                 _merge |      Freq.     Percent        Cum.
------------------------+-----------------------------------
        master only (1) |    140,252       69.20       69.20
         using only (2) |     32,739       16.15       85.36
            matched (3) |     29,679       14.64      100.00
------------------------+-----------------------------------
                  Total |    202,670      100.00

. drop if _merge==2
(32739 observations deleted)

. drop _merge

. 
. ************************************************************
. *** Remark: Don't care about observations with _merge==2,
. *** they are due to different time intervals, not to different
. *** firms. That is, patent data starts already in 1969 whereas
. *** Compustat starts in 1986. 
. **************************************************************
. 
. 
. /*              **********************************************************
>                 *****                VERY IMPORTANT STEP             *****
>                 *****           WE KEEP ONLY AMERICAN FIRMS          *****
>                 *****             FOR WHICH WE HAVE SALES            *****
>                 **********************************************************
> 
> count if countryinc!=0
> 
> * sales are changed into sales_new by substracting forn_sales
> 
> replace forn_sales=0 if  forn_sales==.
> gen sales_new=sales- forn_sales
> count if sales_new<0
> replace sales_new=. if sales_new<0
> count if sales_new==.
> drop if sales_new==.
> label var sales_new "Sales - foreign sales"
> 
> compress
> drop countryinc vantagekey sales forn_sales
> 
> */
. 
. ********************* we correct some variables  ****************
. ********************* and generate some others     ****************
. 
. so ticker year SIC

. egen firmnum=group(ticker)

. label var firmnum "group(ticker)"

. * this is just to control that there are no mistake in the panel
. * if everythnig is correct no observation should be dropped!!
. count if firmnum==firmnum[_n-1]& year==year[_n-1] & SIC ==SIC[_n-1]
    0

. *0
. 
. 
. 
. ********************************************************
. *****           
. *****           NETWORK
. *****           
. ********************************************************
. 
. 
. 
. replace  links1_tot=0 if  links1_tot==.
(169931 real changes made)

. replace  links2_tot=0 if  links2_tot==.
(169931 real changes made)

. replace links1=0 if links1==.
(169931 real changes made)

. replace links2=0 if links2==.
(169931 real changes made)

. replace links2_same=0 if links2_same==.
(169931 real changes made)

. replace links2_diff=0 if links2_diff==.
(169931 real changes made)

. 
. gen links1_ver= links1_tot-links1

. label var links1_ver "Pure vertical links (i.e. links with non-competitors) with double counting"

. gen links2_ver= links2_tot-links2

. label var links2_ver "Pure vertical links (i.e. links with non-competitors) without double counting"

. 
. 
. gen network=links2/(ncomp-1)
(2210 missing values generated)

. label var network "links2/competitors"

. 
. * we have to make a small correction since for some obs. the number of links is larger than the number of competitors (# of f
> irms -1)
. * this is because we have 11 firms in the RJV that have no sales and we dropped these observations
. * these firms are: DEC  DGN.    FMC     GCHI    HLN     HPQ     IDL.1   LCE     MSA.1   NSTS    SDW
. 
. replace network=1 if links2>ncomp-1
(0 real changes made)

. replace network=0 if network==.
(2210 real changes made)

. 
. gen network2=network*network

. label var network2 "network squared"

. 
. 
. gen network_ver=links2_ver/(ncomp-1)
(2210 missing values generated)

. label var network "links2_ver/competitors"

. 
. gen network_ver2=network_ver*network_ver
(2210 missing values generated)

. label var network "network_ver squared"

. 
. 
.                 **** dividing between RJV in the same SIC industry 
.                 **** and in different SIC industry
. 
. gen network_s=links2_same/(ncomp-1)
(2210 missing values generated)

. label var network_s "same ind. links2/competitors"

. 
. * we have to make a small correction since for some obs. the number of links is larger than the number of competitors (# of f
> irms -1)
. 
. replace network_s=1 if links2_same>ncomp-1
(0 real changes made)

. replace network_s=0 if network_s==.
(2210 real changes made)

. 
. gen network_s2=network_s*network_s

. label var network_s2 "network_s squared"

. 
. gen network_d=links2_diff/(ncomp-1)
(2210 missing values generated)

. label var network_d "diff. ind. links2/competitors"

. 
. * we have to make a small correction since for some obs. the number of links is larger than the number of competitors (# of f
> irms -1)
. replace network_d=1 if links2_diff>ncomp-1
(0 real changes made)

. replace network_d=0 if network_d==.
(2210 real changes made)

. 
. gen network_d2=network_d*network_d

. label var network_d2 "network_d squared"

. 
. 
. ********************************************************
. *****           
. *****           INDUSTRY NETWORK
. *****           
. ********************************************************
. 
. 
. * here we generate the ind_links which is the aggregation at the industry level
. 
. * sum of all links
. egen sumlinks=sum(links2), by(SIC year)

. label var sumlinks "sum of all links2"

. 
. gen ind_network=0

. replace ind_network=2*sumlinks/((ncomp-1)*ncomp) if links2>0
(0 real changes made)

. label var ind_network "2*sumlinks/((ncomp-1)*ncomp)"

. 
. * also here we make a correction
. * replace ind_network=1 if ind_net>1 & ind_network!=.
. 
. gen ind_network2=ind_network*ind_network

. label var ind_network2 "ind_network squared"

. 
. 
. 
. ********************************************************
. *****           
. *****           INDUSTRY NETWORK-same
. *****           
. ********************************************************
. 
. 
. * here we generate the ind_links which is the aggregation at the industry level
. 
. * sum of all links
. egen sumlinks_s=sum(links2_same), by(SIC year)

. label var sumlinks "sum of all links2_same"

. 
. gen ind_network_s=0

. replace ind_network_s=2*sumlinks_s/((ncomp-1)*ncomp) if links2>0
(0 real changes made)

. label var ind_network_s "2*sumlinks_s/((ncomp-1)*ncomp)"

. 
. * also here we make a correction
. * replace ind_network_s=1 if ind_network_s>1 & ind_network_s!=.
. 
. gen ind_network_s2=ind_network_s*ind_network_s

. label var ind_network_s2 "ind_network_s squared"

. 
. 
. 
. ********************************************************
. *****           
. *****           INDUSTRY NETWORK-different
. *****           
. ********************************************************
. 
. 
. * here we generate the ind_links which is the aggregation at the industry level
. 
. * sum of all links
. egen sumlinks_d=sum(links2_diff), by(SIC year)

. label var sumlinks "sum of all links2_diff"

. 
. gen ind_network_d=0

. replace ind_network_d=2*sumlinks_d/((ncomp-1)*ncomp) if links2_diff>0
(0 real changes made)

. label var ind_network_d "2*sumlinks_d/((ncomp-1)*ncomp)"

. 
. * also here we make a correction
. * replace ind_network_d=1 if ind_network_d>1 & ind_network_d!=.
. 
. gen ind_network_d2=ind_network_d*ind_network_d

. label var ind_network_d2 "ind_network_d squared"

. 
. 
. 
. ********************************************************
. *****           
. *****           RJV in same/different industry
. *****           
. ********************************************************
. 
. drop  RJVsame RJVdiff

. gen RJVsame=0

. replace RJVsame=1 if links2>0
(0 real changes made)

. label var RJVsame "=1 if the firm meets at least one competitior in the RJV(s)"

. 
. gen RJVdiff=0

. replace RJVdiff= RJV-RJVsame if RJV>0
(163867 real changes made, 153088 to missing)

. label var RJVdiff "=1 if the firm does not meet any competitior in the RJV(s)"

. 
. gen lRJVtotal=log(RJVtotal+1)
(153088 missing values generated)

. label var lRJVtotal "log(RJVtotal+1)"

. 
. desc

Contains data from segment_compustatvars.dta
  obs:       169,931                          
 vars:            71                          18 Dec 2014 18:05
 size:    54,038,058                          
-------------------------------------------------------------------------------------------------------------------------------
              storage   display    value
variable name   type    format     label      variable label
-------------------------------------------------------------------------------------------------------------------------------
ticker          str8    %9s                   Ticker Symbol
year            float   %10.0g                calender year
SIC             int     %10.0g                SIC Code (Primary)
dataset         str6    %9s                   Indicates the origin of Obvervation
cusip           str9    %9s                   
name            str29   %29s                  
sales           float   %9.0g                 Sales in segment, in thousands
ta_new          float   %9.0g                 Total Asset in segment, in thousands
rd_new          float   %9.0g                 R&D Expenses in segment, in thousands
sales_prop      float   %9.0g                 Proportion of total sales in segment
ta_corr         float   %9.0g                 
rd_corr         float   %9.0g                 
SIC2            float   %9.0g                 SIC4/100
ncomp           float   %9.0g                 number of competitors per year/SIC4
tot_sales       float   %9.0g                 sum of sales by SIC, year
MS              float   %9.0g                 Market shares firm/year at the SIC level
HHI             float   %9.0g                 HHI index at the SIC level
RJVtotal        float   %9.0g                 Number of RJVs in which the firm participates in in that year
RJV             float   %9.0g                 Dummy =1 if the firm is at least in one RJV in that year
RJVsametot      float   %9.0g                 Number of RJVs with competitors in which the firm participates in in that year a
RJVdifftot      float   %9.0g                 Number of RJVs without competitors in which the firm participates in in that yea
RJVnfirms       float   %9.0g                 Number of firms in the RJVs where the firm paricipates
RJVnsame        float   %9.0g                 Number of firms from the same SIC4 in the RJVs where the firm paricipates
RJVndiff        float   %9.0g                 Number of firms from a different SIC4 in the RJVs where the firm paricipates
links1_tot      float   %9.0g                 Total direct links with double counting-RJV
links2_tot      float   %9.0g                 Total direct links without double counting-RJV
links1          float   %9.0g                 Direct links with double counting
links2          float   %9.0g                 Direct links without double counting
links_MS1_tot   float   %9.0g                 Market share of total direct links with double counting-RJV
links_MS2_tot   float   %9.0g                 Market share of total direct links without double counting-RJV
links1_same     float   %9.0g                 Direct links with double counting-RJV, Firm-SIC = RJV-SIC
links2_same     float   %9.0g                 Direct links without double counting-RJV, Firm-SIC = RJV-SIC
links_MS1_same  float   %9.0g                 Market share of direct links with double counting-RJV, Firm-SIC = RJV-SIC
links_MS2_same  float   %9.0g                 Market share of direct links without double counting-RJV, Firm-SIC = RJV-SIC
links1_diff     float   %9.0g                 Direct links with double counting-RJV, Firm-SIC is not RJV-SIC
links2_diff     float   %9.0g                 Direct links without double counting-RJV in same SIC, Firm-SIC is not RJV-SIC
links_MS1_diff  float   %9.0g                 Market share of direct links with double counting-RJV, Firm-SIC is not RJV-SIC
links_MS2_diff  float   %9.0g                 Market share of direct links without double counting-RJV, Firm-SIC is not RJV-SI
numpatentsy     float   %9.0g                 number of patents in a certain year
claimsy         float   %9.0g                 sum of claims in a certain year
avclaims        float   %9.0g                 claimsy divided by numpatentsy
S               float   %9.0g                 spillover variable with sic specific rd, patents
Sa              float   %9.0g                 spillover variable with aggregated rd, patents
patents         float   %9.0g                 patentstock, depreciated
patents_t_1     float   %9.0g                 patentstock, lag 1
patents_t_2     float   %9.0g                 patentstock, lag 2
patents_t_3     float   %9.0g                 patentstock, lag 3
patents_t_4     float   %9.0g                 patentstock, lag 4
firmnum         float   %9.0g                 group(ticker)
links1_ver      float   %9.0g                 Pure vertical links (i.e. links with non-competitors) with double counting
links2_ver      float   %9.0g                 Pure vertical links (i.e. links with non-competitors) without double counting
network         float   %9.0g                 network_ver squared
network2        float   %9.0g                 network squared
network_ver     float   %9.0g                 
network_ver2    float   %9.0g                 
network_s       float   %9.0g                 same ind. links2/competitors
network_s2      float   %9.0g                 network_s squared
network_d       float   %9.0g                 diff. ind. links2/competitors
network_d2      float   %9.0g                 network_d squared
sumlinks        float   %9.0g                 sum of all links2_diff
ind_network     float   %9.0g                 2*sumlinks/((ncomp-1)*ncomp)
ind_network2    float   %9.0g                 ind_network squared
sumlinks_s      float   %9.0g                 
ind_network_s   float   %9.0g                 2*sumlinks_s/((ncomp-1)*ncomp)
ind_network_s2  float   %9.0g                 ind_network_s squared
sumlinks_d      float   %9.0g                 
ind_network_d   float   %9.0g                 2*sumlinks_d/((ncomp-1)*ncomp)
ind_network_d2  float   %9.0g                 ind_network_d squared
RJVsame         float   %9.0g                 =1 if the firm meets at least one competitior in the RJV(s)
RJVdiff         float   %9.0g                 =1 if the firm does not meet any competitior in the RJV(s)
lRJVtotal       float   %9.0g                 log(RJVtotal+1)
-------------------------------------------------------------------------------------------------------------------------------
Sorted by:  ticker  year  SIC
     Note:  dataset has changed since last saved

. 
. use estimation_sample_segment.dta, clear

. rename SIC SIC4

. egen obs_num=group(ticker SIC4)

. rename sales sales_new

. *so ticker year
. 
. gen lta=log(ta_new+1)
(3969 missing values generated)

. label var lta "Log total assents in millions dollars"

. 
. 
. * we drop one industry (59 observations + 1 obs) which has a wierd pattern
. 
. gen drop=0

. /*
> replace drop=1 if SIC4==3241
> replace drop=1 if network==1
> *drop if drop==1
> */
. 
. * here we first define those industries where no RJV was formed
. * these observations will represent the "zeros"
. 
. gen aa=RJV
(153088 missing values generated)

. egen bb=max(aa), by(SIC4)
(24239 missing values generated)

. replace bb=0 if bb==.
(24239 real changes made)

. gen zeros=0

. replace zeros=1 if bb==0
(28976 real changes made)

. drop aa bb

. 
. 
. gen aa=RJVsame

. egen bb=max(aa), by(SIC4)

. gen zero_same=0

. replace zero_same=1 if bb==0
(83172 real changes made)

. drop aa bb

. 
. 
. replace patents=0 if patents==.
(140236 real changes made)

. replace patents_t_1=0 if patents_t_1==.
(140236 real changes made)

. replace patents_t_2=0 if patents_t_2==.
(140236 real changes made)

. replace patents_t_3=0 if patents_t_3==.
(140236 real changes made)

. replace patents_t_4=0 if patents_t_4==.
(140236 real changes made)

. 
. 
. gen only_ver=0

. replace only_ver=1 if network==0 & RJV==1
(5053 real changes made)

. 
. egen m_rdexpense=mean(rd_corr), by(SIC4 year)
(17601 missing values generated)

. label var m_rdexpense"Mean R&D exp. at the SIC4/year level"

. 
. egen m_lta=mean(lta), by(SIC4 year)
(95 missing values generated)

. label var m_lta "Mean log total asset at the SIC4/year level

. 
. * here we redefine the RJV dummies
. 
. gen RJV2=RJV
(153088 missing values generated)

. replace RJV2=0 if RJV2==.
(153088 real changes made)

. 
. 
. * horizontal vs. vertical
. 
. gen RJVsame2=RJVsame

. replace RJVsame2=0 if RJVsame2==.
(0 real changes made)

. rename RJVsame2 RJVhor

. label var RJVhor "RJV with firms from the same industry"

. 
. 
. gen RJVdiff2=RJVdiff
(153088 missing values generated)

. replace RJVdiff2=0 if RJVdiff==.
(153088 real changes made)

. rename RJVdiff2 RJVver

. label var RJVver "RJV without firms from the same industry"

. 
. * horizontal in the same industry vs. different industry
. 
. 
. gen RJVsame2=0

. replace RJVsame2=1 if network_s>0
(1224 real changes made)

. label var RJVsame2 "RJV with competitors in the same industry"

. 
. gen RJVdiff2=0

. replace RJVdiff2=1 if RJVsame2==0 & RJVhor==1
(4502 real changes made)

. label var RJVsame2 "RJV with competitors in different industries"

. 
. 
. * we replace the missing with zeros in the r&d variable 
. 
. gen rd2=rd_corr
(100372 missing values generated)

. replace rd2=0 if rd2==. | rd2<0
(100375 real changes made)

. gen lrd2=log(rd2+1)

. 
. gen ta=ta_corr
(2829 missing values generated)

. replace ta=0 if ta==. 
(2829 real changes made)

. replace lta=log(ta+1)
(3948 real changes made)

. 
. * we create a R&D intensity variable
. gen rd_int=rd2/sales_new
(4517 missing values generated)

. 
. 
. * we generate industry specific variables
. 
. egen m_rd=mean(rd2), by(SIC4 year)

. label var m_rd "Mean R&D exp. at the SIC4/year level

. 
. egen m_lrd=mean(lrd2), by(SIC4 year)

. label var m_rd "Mean log R&D exp. at the SIC4/year level

. 
. * we generate other coverage variables
. 
. gen only_horiz=0

. replace only_horiz=1 if network>0
(5726 real changes made)

. 
. egen nRJVfirm_hor=sum(only_horiz), by(SIC4 year)

. gen coverage= nRJVfirm_hor/ncom

. replace coverage=0 if network==0
(52614 real changes made)

. gen coverage2=coverage*coverage

. 
. 
. gen only_horiz_s=0

. replace only_horiz_s=1 if network_s>0
(1224 real changes made)

. 
. 
. *** we generate the coverage variables
. 
. egen nRJVfirm_hor_s=sum(only_horiz_s), by(SIC4 year)

. gen coverage_s= nRJVfirm_hor_s/ncom

. replace coverage_s=0 if network_s==0
(16225 real changes made)

. gen coverage_s2=coverage_s*coverage_s

. 
. egen coverageMS=sum(MS) if coverage>0, by(SIC4 year)
(164205 missing values generated)

. replace coverageMS=0 if network==0
(164205 real changes made)

. gen coverageMS2=coverageMS*coverageMS

. 
. 
. *** we generate the vertical links
. 
. replace links2_tot=0 if links2_tot==.
(0 real changes made)

. gen links_ver=links2_ver

. 
. *label var RJVeff2 "Heterogenous effect (RJV dummies)"
. *label var RJVeff_s2 "Heterogenous effect (RJV dummies)"
. label var network "RJV network coverage"

. label var network_s "RJV network coverage"

. label var network_d "RJV network coverage"

. label var RJV2 "RJV"

. label var RJVver "Vertical RJV"

. label var RJVhor "Horizontal RJV"

. label var links_ver "Vertical links"

. label var lrd2 "log(R&D)"

. label var m_lrd "log(R&D) SIC4"

. 
. gen RJVhor_s=0

. replace RJVhor_s=1 if network>0 & network<.0267857
(1430 real changes made)

. 
. gen RJVhor_m=0

. replace RJVhor_m=1 if network>=.0267857 & network<.13
(2862 real changes made)

. 
. gen RJVhor_l=0

. replace RJVhor_l=1 if network>=.13
(1434 real changes made)

. 
. gen pat_corr=patents*sales_prop
(3654 missing values generated)

. gen networkMS=links_MS2_tot
(159152 missing values generated)

. 
. 
. *****************************************************
. *** here we define a firm to be in vertical networks if all its formed pair in 1997
. *** are with other firms with which the closeness measure in the product space is zero
. *** i.e. the intersection of the SIC4 vectors is empty
. *****************************************************
. 
. so ticker year

. merge ticker using "RJVver_sure97"
(note: you are using old merge syntax; see [D] merge for new syntax)
variable ticker does not uniquely identify observations in the master data

. tab _merge

     _merge |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |    166,118       97.73       97.73
          2 |         52        0.03       97.76
          3 |      3,813        2.24      100.00
------------+-----------------------------------
      Total |    169,983      100.00

. drop if _merge==2
(52 observations deleted)

. 
. xtset obs_num year
       panel variable:  obs_num (unbalanced)
        time variable:  year, 1986 to 1999, but with gaps
                delta:  1 unit

. rename  RJVver_sure  RJVver_sure97

. gen  RJVver_sure= RJVver_sure97
(166118 missing values generated)

. replace  RJVver_sure=0 if  RJVver_sure==.
(166118 real changes made)

. replace RJVver_sure=0 if RJV2==0
(1583 real changes made)

. gen RJVver_nsure=RJVver

. replace RJVver_nsure=0 if RJVver_sure==1
(1604 real changes made)

. 
. tab RJVver_sure RJVhor if zero_same==0

RJVver_sur |    Horizontal RJV
         e |         0          1 |     Total
-----------+----------------------+----------
         0 |    80,376      5,100 |    85,476 
         1 |       657        626 |     1,283 
-----------+----------------------+----------
     Total |    81,033      5,726 |    86,759 


. 
. * here we observe that we have 626 observations which are horizontal for our databse
. * and are assigned ot be vertical in 1997
. 
. gen inconsistent=0

. replace inconsistent=1 if RJVhor==1 & RJVver_sure==1
(626 real changes made)

. tab year inconsistent

  calender |     inconsistent
      year |         0          1 |     Total
-----------+----------------------+----------
      1986 |    11,119         17 |    11,136 
      1987 |    11,167         19 |    11,186 
      1988 |    10,984         26 |    11,010 
      1989 |    10,743         29 |    10,772 
      1990 |    10,637         33 |    10,670 
      1991 |    10,657         47 |    10,704 
      1992 |    11,022         50 |    11,072 
      1993 |    12,052         47 |    12,099 
      1994 |    12,415         41 |    12,456 
      1995 |    13,192         51 |    13,243 
      1996 |    13,384         64 |    13,448 
      1997 |    13,023         61 |    13,084 
      1998 |    14,467         66 |    14,533 
      1999 |    14,443         75 |    14,518 
-----------+----------------------+----------
     Total |   169,305        626 |   169,931 


. 
. * we can assign the inconsistent cases to horizontal
. * i.e we define RJVver_sure2 which is 0 for inconistent cases 
. 
. gen  RJVver_sure2= RJVver_sure

. replace  RJVver_sure2=0 if  inconsistent==1
(626 real changes made)

. 
. gen RJVver_nsure2=RJVver

. replace RJVver_nsure2=0 if RJVver_sure2==1
(1604 real changes made)

. 
. keep MS sales_new ta rd2 rd_int patents pat_corr network networkMS coverage RJVsametot links2_ver m_rdexpense m_lta ncomp RJV
> 2 zero_same  dy* ticker RJVver RJVhor links_ver-RJVver_nsure2 obs_num year drop lrd2 m_lrd patents* network2

. save RESTATestimation_sample_segment.dta, replace
(note: file RESTATestimation_sample_segment.dta not found)
file RESTATestimation_sample_segment.dta saved

. 
. log close
      name:  <unnamed>
       log:  E:\REStat_MS14767_Vol96(2)\Data preparation Compustat segment\12_estimation_sample.log
  log type:  text
 closed on:  19 Dec 2014, 21:51:21
-------------------------------------------------------------------------------------------------------------------------------
